package com.az.miaoauth.controller;

import com.az.miaoauth.service.EmailService;
import com.az.servicecommon.domain.NullVo;
import com.az.servicecommon.domain.Vo;
import com.az.servicecommon.util.BaseResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@BaseResponse
@RequestMapping("/auth/email")
@RequiredArgsConstructor
public class EmailController {
    private final EmailService emailService;

    @GetMapping("/code")
    public Vo sendCodeEmail(@RequestParam("email") String emailTo) {
        emailService.sendVerificationCode(emailTo);
        return new NullVo();
    }
}
